/*
    gtk-webrtc-softphone
    Copyright (C) 2012  amkuzink@gmail.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "mainwindow.h"

CMainWindow::CMainWindow(WindowType type): Window(WINDOW_TOPLEVEL)
{
// 	set_default_size(400, 200);
 	set_title("Gtk WebRTC Softphone");
	set_border_width(10);
 
 	m_glabelEnterNumber = new Label("Enter number to call:");
 	m_gbtnMakeCall = new Button("Call");
	m_gbtnMakeCall->set_size_request(50, 30);
 	m_gentryNumberToCall = new Entry;
	
 	m_ghboxCall = new HBox;
 	m_ghboxCall->add(*m_gentryNumberToCall);
 	m_ghboxCall->add(*m_gbtnMakeCall);

	m_gvboxMainWindow = new VBox;
	m_gvboxMainWindow->add(*m_glabelEnterNumber);
	m_gvboxMainWindow->add(*m_ghboxCall);

	add(*m_gvboxMainWindow);

	show_all_children();
 	m_glabelEnterNumber->set_visible(false);

	m_gbtnMakeCall->signal_clicked().connect(sigc::mem_fun(*this, &CMainWindow::on_gbtnMakeCall_clicked));
}

CMainWindow::~CMainWindow()
{
	
}

void CMainWindow::on_gbtnMakeCall_clicked()
{
	m_glabelEnterNumber->set_visible(true);
}
